import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import Home from '../views/home/index.vue'
import Test from '../views/test/index.vue'
import Data from '../views/data/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',

    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: '/home/test/',
          name: 'data',
          component: Data,
          // props(route){
          //   console.log(route,"route")
          //   return route.params
          // },
           props: {
             id: 1,
             name: 'geyao',
             age: 18,
           },
        },
        // <Data id=xxx name=xxx age=xxx />
      ],
    },
    {
      path: '/test',
      name: 'test',
      component: Test,
    },
  ],
})

export default router
